<?php
require_once(APPPATH . '/models/cmf_artist_model.php');

class CMF_Artist_edit_model extends CMF_Artist_model{
	function CMF_Artist_edit_model(){
		parent::CMF_Artist_model();
		
		$this->addDataProcessorField('ProcessMultipleImages', 'images', array('table' => 'artist_images', 'new_field' => 'new_images_upload', 'sort_field' => 'images_single_container_multiselect_order', 'table_order_field' => 'order_index', 'relational_fields' => array('id', 'image_id')));
		$this->fields['images'] =  array(
										'name'				=> 'Images',
										'view'				=> false,
										'edit'				=> array(
																'func'	=> array('Form_wrapper', 'form_dropdown_wrapper'),
																'params'	=> array(
																				array(
																					'id'	=> 'images',
																					'class'	=> 'image_list', //image_selection_list
																					'multiple'	=> 'multiple'
																				)
																			),
																'label'	=> true,
																'help'  => '
																<p>Upload up to 5 JPEG images (up to 256KB each) using the "Browse" button below. Appropriate images are: your recent work, your work that are not 
																presented on the artasiamerica profile, exhibition documents, sketches/drawings, etc.</p>
																<p>After uploading, you may drag the images to re-order them, click the edit button to edit the selected image, or click the delete 
																button to delete it.</p>'
															),
										'rules'				=> ''
									);
		$this->fields['images_upload'] = array(
												'name'		=> 'Upload New Image',
												'view'		=> false,
												'edit'		=> array(
																'func'		=> array('Form_wrapper', 'form_upload_wrapper'),
																'view'		=> false,
																'params'	=> array(
																					array(
																						'id' => 'images_upload', 
																						'class' => 'image_list_ajax_upload',
																						'title'	=> base_url() . CMF_PREFIX . 'artistimageupload/doupload/images_upload'
																						)
																					),
																'label'		=> true
															),
												'rules'				=> ''
											);
		$this->fields['username'] = $this->fields['active'] = $this->fields['archive_artist_id'] = $this->fields['password'] = $this->fields['password_confirmation'] = null;
	}
}
?>